package base;

import java.util.*;

/**
 *
 */
public class Coffee extends Product {

    /**
     * Default constructor
     */

    /**
     *Origin of the coffee
     */
    private String origin;
    /**
     *Roast of the coffee
     */
    private String roast;
    /**
     *Flavor of the coffee
     */
    private String flavor;
    /**
     *Aroma of the coffee
     */
    private String aroma;
    /**
     *Acidity of the coffee
     */
    private String acidity;
    /**
     *Body of the coffee
     */
    private String body;

    public Coffee(String initialCode,String initialDescription, double initialPrice,String initialOrigin,String initialRoast,String initialFlavor,String initialAroma,String initialAcidity,String initialBody) {
        super(initialCode,initialDescription,initialPrice);
        origin = initialOrigin;
        roast = initialRoast;
        flavor = initialFlavor;
        aroma = initialAroma;
        acidity = initialAcidity;
        body = initialBody;
    }

    public Coffee(String[] product_param) {
        super(product_param[0],product_param[1], Double.parseDouble(product_param[2]));
        origin = product_param[3];
        roast = product_param[4];
        flavor = product_param[5];
        aroma = product_param[6];
        acidity = product_param[7];
        body = product_param[8];
    }

    /**
     * @return the origin of the coffee
     */
    public String getOrigin() {
        return origin;
    }
    /**
     * @return the roast of the coffee
     */
    public String getRoast() {
        return roast;
    }
    /**
     * @return the flavor of the coffee
     */
    public String getFlavor() {
        return flavor;
    }
    /**
     * @return the aroma of the coffee
     */
    public String getAroma() {
        return aroma;
    }
    /**
     * @return the acidity of the ocffee
     */
    public String getAcidity() {
        return acidity;
    }
    /**
     * @return the body of the coffee
     */
    public String getBody() {
        return body;
    }

    /**
     * @author tuxiaobei
     * @return Coffee detail string
     */
    //in Coffee
    @Override
    public String toString() {
        String res = super.toString();
        res += "Origin:" + getOrigin() + '\n';
        res += "Roast:" + getRoast() + '\n';
        res += "Flavor:" + getFlavor() + '\n';
        res += "Aroma:" + getAroma() + '\n';
        res += "Acidity:" + getAcidity() + '\n';
        res += "Body:" + getBody() +'\n';
        return res;
    }
}

